﻿using System;
using System.Windows;

namespace C11_PRC_Editor
{
    internal class C11UCPrcEditor : DependencyObject
    {
        #region Public Fields

        public Engine.FileFormats3D.C11Undercover.C11UcPrcFile c11UcPrcFile;

        #endregion Public Fields

        #region Public Constructors

        public C11UCPrcEditor()
        {
            c11UcPrcFile = new Engine.FileFormats3D.C11Undercover.C11UcPrcFile();
        }

        #endregion Public Constructors

        #region Public Events

        public event EventHandler FileLoaded;

        #endregion Public Events

        #region Public Properties

        public float AmbExtra
        {
            get { return c11UcPrcFile.AmbExtra; }
            set { c11UcPrcFile.AmbExtra = value; }
        }

        public float AmbNDiff
        {
            get { return c11UcPrcFile.AmbNDiff; }
            set { c11UcPrcFile.AmbNDiff = value; }
        }

        public float AmbObHB
        {
            get { return c11UcPrcFile.AmbObHB; }
            set { c11UcPrcFile.AmbObHB = value; }
        }

        public float AmbObHG
        {
            get { return c11UcPrcFile.AmbObHG; }
            set { c11UcPrcFile.AmbObHG = value; }
        }

        public float AmbObHR
        {
            get { return c11UcPrcFile.AmbObHR; }
            set { c11UcPrcFile.AmbObHR = value; }
        }

        public float AmbObj
        {
            get { return c11UcPrcFile.AmbObj; }
            set { c11UcPrcFile.AmbObj = value; }
        }

        public float AmbObjB
        {
            get { return c11UcPrcFile.AmbObjB; }
            set { c11UcPrcFile.AmbObjB = value; }
        }

        public float AmbObjG
        {
            get { return c11UcPrcFile.AmbObjG; }
            set { c11UcPrcFile.AmbObjG = value; }
        }

        public float AmbObjR
        {
            get { return c11UcPrcFile.AmbObjR; }
            set { c11UcPrcFile.AmbObjR = value; }
        }

        public float AmbObLB
        {
            get { return c11UcPrcFile.AmbObLB; }
            set { c11UcPrcFile.AmbObLB = value; }
        }

        public float AmbObLG
        {
            get { return c11UcPrcFile.AmbObLG; }
            set { c11UcPrcFile.AmbObLG = value; }
        }

        public float AmbObLR
        {
            get { return c11UcPrcFile.AmbObLR; }
            set { c11UcPrcFile.AmbObLR = value; }
        }

        public float AmbScn
        {
            get { return c11UcPrcFile.AmbScn; }
            set { c11UcPrcFile.AmbScn = value; }
        }

        public float AmbScnB
        {
            get { return c11UcPrcFile.AmbScnB; }
            set { c11UcPrcFile.AmbScnB = value; }
        }

        public float AmbScnG
        {
            get { return c11UcPrcFile.AmbScnG; }
            set { c11UcPrcFile.AmbScnG = value; }
        }

        public float AmbScnR
        {
            get { return c11UcPrcFile.AmbScnR; }
            set { c11UcPrcFile.AmbScnR = value; }
        }

        public float AmbTrx
        {
            get { return c11UcPrcFile.AmbTrx; }
            set { c11UcPrcFile.AmbTrx = value; }
        }

        public float Sun
        {
            get { return c11UcPrcFile.Sun; }
            set { c11UcPrcFile.Sun = value; }
        }

        #endregion Public Properties

        #region Public Methods

        public void Load(string filename)
        {
            this.c11UcPrcFile = Engine.FileFormats3D.C11Undercover.C11UcPrcFile.FromFile(filename);
            if (this.FileLoaded != null)
                this.FileLoaded(this, null);
        }

        #endregion Public Methods

        #region Internal Methods

        internal void Save(string filename)
        {
            if (c11UcPrcFile != null)
                c11UcPrcFile.ToFile(filename);
            else
                throw new Exception("No Prc-File loaded!");
        }

        #endregion Internal Methods
    }
}